<?php
/**
 * Created by PhpStorm.
 * User: mawenhuan
 * Date: 2019-06-06
 * Time: 09:48
 */

namespace App\Utils;


class HelpersUtil
{

    //判断是否是微信
    public static function is_weixin()
    {
        if (strpos($_SERVER['HTTP_USER_AGENT'],
                'MicroMessenger') !== false
        ) {
            return true;
        }
        return false;
    }

    public static function getPhoneWidthAndHeight()
    {
        $width = $_SERVER['HTTP_ScreenWidth'] ?? 414;
        $height = $_SERVER['HTTP_ScreenHeight'] ?? 736;

        return ['width' => $width, 'height' => $height];
    }
}
